import React, { useState } from 'react';
import { View, Switch, StyleSheet } from 'react-native';

const styles = StyleSheet.create({
	container: {
		flex: 1,
		alignItems: 'center',
		justifyContent: 'center'
	}
});
const SwitchPage = () => {
	const [isEnabled, setIsEnabled] = useState(false);
	const toggleSwitch = () => setIsEnabled(previousState => !previousState);

	return (
		<View style={styles.container}>
			<Switch
    ios_backgroundColor="#3e3e3e"
    onValueChange={toggleSwitch}
    thumbColor={isEnabled ? '#f5dd4b' : '#f4f3f4'}
    trackColor={{ false: '#767577', true: '#81b0ff' }}
    value={isEnabled}
			/>
		</View>
	);
};

export default SwitchPage;
